//
//  ProjectData.h
//  OutesIOS
//
//  Created by norman on 2018/11/23.
//  Copyright © 2018 norman. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RoomData.h"
#import "MainEquipSystemData.h"
#import "QrjhqSystemData.h"
#import "KqnrsjSystemData.h"
#import "WaterCleanerEquipData.h"

NS_ASSUME_NONNULL_BEGIN

typedef enum {
    KPROJECT_PHASE_ALL = 0,//进行中的
    KPROJECT_PHASE_DEAL = 1,//成交未审核
    KPROJECT_PHASE_NOTDEAL = 2,//未成交
    KPROJECT_PHASE_REVIEW = 4, //成交已经审核
    KPROJECT_SUB = 8 //子项目
}KKPROJECT_PHASE;

typedef enum {
    KPROJECT_STATUS_INIT = 0, //项目还没有创建
    KPROJECT_STATUS_NEW, //新建项目中
    KPROJECT_STATUS_MODIFY //修改项目
    
}KKPROJECT_STATUS;


//室外机(swj),轻型商用空调(qxsykt),空气能热水机(kqnrsj),全热 交换器(qrjhq)
#define MACHINE_TAG_FOR_FCU @"fcu_equip"
#define MACHINE_TAG_FOR_MAIN @"main_equip"
#define MACHINE_TAG_FOR_KQNRSJ @"kqnrsj_equip"
#define MACHINE_TAG_FOR_QRJHQ @"qrjhq_equip"
#define MACHINE_TAG_FOR_WATER_CLEANER @"water_cleaner_equip"//净水机

@interface ProjectData : NSObject<NSCoding>

@property (nonatomic,copy)NSString *project_id;
@property (nonatomic,copy)NSString *user_id;
@property (nonatomic,copy)NSString *name; //创建人姓名
@property (nonatomic,copy)NSString *company_name; //创建人公司名称
@property (nonatomic,copy)NSString *city_name; //城市地点
@property (nonatomic,copy)NSString *city_id; //城市Id
/**
 * 项目需求: 1 空调 2 地暖 3 空调+地暖
 */
@property (nonatomic,copy)NSString *requirement;

/**
 * 项目类型: 家装项目 工装项目
 */
@property (nonatomic,copy)NSString *terminal_type;
/**
 * 电源类型: 1 220V 电压 2 380V 电压 3 全部设备
 */
@property (nonatomic,copy)NSString * power_type;

@property (nonatomic,copy)NSString *project_name;
@property (nonatomic,assign)double area; //面积
@property (nonatomic,assign)double floor_height;
@property (nonatomic,assign)int house_floors;
@property (nonatomic,copy)NSString *owner_name;
@property (nonatomic,copy)NSString *owner_tel;
@property (nonatomic,assign)int is_lock;
@property (nonatomic,assign)int template_bind;
@property (nonatomic,strong)NSMutableArray *rooms; //项目中的房间
@property (nonatomic,copy)NSString *images; //项目中的图片
@property (nonatomic,copy)NSString *report; //项目报告
@property (nonatomic,assign)int coeff_input; //是否必须要输入同时使用系数

@property (nonatomic,copy)NSString *main_equip_series; //项目中默认选择的室外机系列
@property (nonatomic,copy)NSString *kqnrsj_series; //项目中默认选择的空气能热水机系列
@property (nonatomic,copy)NSString *qrjhq_series; //项目中默认选择的新风系统系列
@property (nonatomic,copy)NSString *water_cleaner_series; //项目中默认选择的净水器
@property (nonatomic,copy)NSString *loop_type; //项目中默认选择的循环方式


@property (nonatomic,strong)NSMutableArray *main_equip_systems; //项目中的主机系统
@property (nonatomic,strong)NSMutableArray *qrjhq_systems; //系统
@property (nonatomic,strong)NSMutableArray *kqnrsj_systems; //空气能热水机系统
@property (nonatomic,strong)NSMutableArray *water_cleaner_equips; //净水机


@property (nonatomic,assign)double equipPrice;
@property (nonatomic,assign)double fuCaiPrice;
@property (nonatomic,assign)double renGongPrice;
@property (nonatomic,assign)double taxRate;
@property (nonatomic,assign)double totalPrice;
@property (nonatomic,assign)double transPrice;
@property (nonatomic,copy)NSString *time;
@property (nonatomic,copy)NSString *userContactName;
/**
 *  项目阶段 InProcess = 1, Deal = 2, NotDeal = 4
 */
@property (nonatomic,assign)int phase;
@property (nonatomic,assign)int state; //项目状态
@property (nonatomic,copy)NSString *comment;
/**
 * 电辅热类型: 1 带电辅热 2 不带电辅热 3 全部设备
 */
@property (nonatomic,assign)int dfrType;

@property (nonatomic,assign)int status;

@property (nonatomic,assign)BOOL isBindTemplate; //是否绑定了模板

@property (nonatomic,strong)NSArray *result;

@property (nonatomic,strong)NSArray *fcuEquips;

/**
 *
 
 系统配置中：
 
 1.室外机开关关闭
 房间中，室内设备不允许添加室内机，室外机系统配置不允许
 
 2.轻型商用空调开关关闭
 房间中，室内设备不允许添加轻型商用空调。
 
 3.如果室外机开关和轻型商用空调开关均关闭
 不显示房间信息页面和室外机系统配置页面。
 
 4.空气能热水机开关关闭
 不显示空气能配置页面
 
 5.开关关闭
 不显示页面配置
 
 */
@property (nonatomic,assign)BOOL swjEnable; //项目中室外机的开关是否打开
@property (nonatomic,assign)BOOL qxsyktEnable; //项目中轻型商用空调的开关是否打开
@property (nonatomic,assign)BOOL kqnrsjEnable; //项目中空气能热水机的开关是否打开
@property (nonatomic,assign)BOOL qrjhqEnable; //项目中的开关是否打开

@property (nonatomic,copy)NSString *snjSeries;

@property (nonatomic,copy)NSString *qxsyktSeries; //项目中默认选择的轻型商用空调系列ID
@property (nonatomic,strong)ProjectData *getProjectResult;

@property (nonatomic,strong)NSArray *getReviewProjectsResult; //获取所有已审核或者未审核项目列表

@property (nonatomic,strong)ProjectData *reviewProjectResult; //审核或者取消审核项目

@property (nonatomic,strong)NSArray *getChildUserProjectsResult; //获取子项目列表


//- (void)initMainEquipSystem:(void (^)(BOOL))result;

- (NSDictionary*)selectFCUWithColdLoad:(double)coldLoad;

- (NSDictionary*)selectSwjWithColdLoad:(double)coldLoad andHeatLoad:(double)heatLoad;

@end

NS_ASSUME_NONNULL_END
